<?php

require_once 'phpmoko/ui/Widget.php';

class Link extends Widget
{
	private $rel;
	private $href;
	private $type = null;

	function Link()
	{
		parent::__construct();
	}

	/**
	 * Options:
	 * alternate, appendix, bookmark, chapter, contents, copyright, glossary,
	 * help, home, index, next, prev, section, start, stylesheet, subsection
	 * @param $rel
	 * @return unknown_type
	 */
	function setRel($rel)
	{
		$this->rel = $rel;
	}

	function getRel()
	{
		return $this->rel;
	}

	function setHref($href)
	{
		$this->href = $href;
	}

	function getHref()
	{
		return $this->href;
	}

	function setType($type)
	{
		$this->type = $type;
	}

	function getType()
	{
		return $this->type;
	}

	function toString()
	{
		$str = '<link';

		if ($this->rel != null)
			$str .= ' rel="'.$this->rel.'"';

		if ($this->type != null)
			$str .= ' type="'.$this->type.'"';

		if ($this->href != null)
			$str .= ' href="'.$this->href.'"';

		$str .= '/>';

		return $str;
	}
}
?>
